Fix obscure porting bug with varargs functions.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 19 Jul 2013 01:24:35 +0000 (18:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 19 Jul 2013 01:24:35 +0000 (18:24 -0700)
commitbc29716effcaf12941c73d2a2675c16b2867fcc4
tree6fb97c7864b46b79a0b4cd17d93d1ef50618b6c2
parent4e3a9e3727db8c5d905947a42b29a3af6e1ed5e3
Fix obscure porting bug with varargs functions.

The code assumed that int is treated like ptrdiff_t in a vararg
function, which is not a portable assumption.  There was a similar
-- though these days less likely -- porting problem with various
assumptions that pointers of different types all smell the same as
far as vararg functions is conserved.  To make this problem less
likely in the future, redo the API to use varargs functions.
* alloc.c (make_save_value): Remove this vararg function.
All uses changed to ...
(make_save_int_int_int, make_save_obj_obj_obj_obj)
(make_save_ptr_int, make_save_funcptr_ptr_obj, make_save_memory):
New functions.
(make_save_ptr): Rename from make_save_pointer, for consistency with
the above.  Define only on platforms that need it.  All uses changed.
src/ChangeLog
src/alloc.c
src/editfns.c
src/fileio.c
src/font.c
src/ftfont.c
src/keymap.c
src/lisp.h
src/nsterm.m
src/w32fns.c
src/xmenu.c